package service;

import Util.SqlSessionUtil;
import dao.ZhejiangGDPMapper;
import domain.ZhejiangGDP;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ZhejiangGDPService {
    public List<ZhejiangGDP> selectDataByCity(String city, Integer year){
        SqlSession session = SqlSessionUtil.getSession().openSession();
        ZhejiangGDPMapper operation = session
                .getMapper(ZhejiangGDPMapper.class);
        List<ZhejiangGDP> nbieList = operation.selectByCityAndYear(city, year);
        session.commit();
        session.close();
        return nbieList;
    }

    public static void main(String[] args) {
        ZhejiangGDPService n = new ZhejiangGDPService();
        System.out.println(n.selectDataByCity("宁波", 2016));
    }
}
